package com.tuanzi.loan.business.service.collaborate.impl;

import com.tuanzi.loan.business.entity.collaborate.CollaborateChannelRatio;
import com.tuanzi.loan.business.repository.collaborate.CollaborateOldChannelRatioRepository;
import com.tuanzi.loan.business.service.collaborate.CollaborateOldChannelRatioService;
import com.tuanzi.loan.core.aspect.Debug;
import com.tuanzi.loan.core.service.CommonServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.retry.RetryException;
import org.springframework.retry.annotation.Retryable;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * User: liangZongXi
 * Create time: 15:13 2019/5/17
 * Description:
 */

@Debug
@Service
@Transactional
@Retryable(value = { RetryException.class })
public class CollaborateOldChannelRatioServiceImpl extends CommonServiceImpl<CollaborateChannelRatio,Integer> implements CollaborateOldChannelRatioService {

    private final CollaborateOldChannelRatioRepository collaborateOldChannelRatioRepository;

    @Autowired
    public CollaborateOldChannelRatioServiceImpl(CollaborateOldChannelRatioRepository collaborateOldChannelRatioRepository) {
        this.collaborateOldChannelRatioRepository = collaborateOldChannelRatioRepository;
    }

    @Override
    protected JpaRepository<CollaborateChannelRatio, Integer> getRepository() {
        return collaborateOldChannelRatioRepository;
    }

    @Override
    public List<CollaborateChannelRatio> findAllIncludeChannelName() {
        return collaborateOldChannelRatioRepository.findAllIncludeChannelName();
    }
}
